<?php
/**************************************************/
/* Programmer: Scott Gildersleeve                 */
/*       Date: 2/2/2013                           */
/*  Page Name: functions.php                      */
/*                                                */
/**************************************************/

/**************************************************/
/* Various PHP functions                          */
/*                                                */
/**************************************************/

/****************************************************************/
/*   Date        Reviser       Revision           				*/
/* --------     ---------     ----------          				*/
/* 2/2/13       S. Gilder      Add check_login()  				*/
/* 2/11/13	    D. Widjaya     Add populate_dropdown_options() 	*/
/*                                                				*/
/****************************************************************/

  /* Check if required information is stored */
   function check_login() {
     if (isset($_SESSION['email']))
	   return true;

	 return false;
   }
   
   /* Popupate a dropdown given an array list of data with id and name column */
   function populate_dropdown_options($DataTable)
   {
      if($DataTable != null)
      {		
		     foreach ($DataTable as $row) 
		     {
			      echo '<option value="' . $row['id'] . '">' . $row['name'] . '</option>';
		     }
      }
      else return null;
   }
?>